package com.taofuxn.admin.api.model.response;

import com.taofuxn.admin.api.model.RoleModel;
import com.taofuxn.admin.api.model.SysUserModel;
import com.taofuxn.admin.common.util.CopyUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author wong
 * @Date: 2020-05-08
 * @Version: 1.0
 */
@Data
public class LoginResponse implements Serializable {

    private static final long serialVersionUID = -5135185816504639247L;

    private String token;
    private UserVo user;

    /**
     * 角色
     */
    private List<RoleModel> roles;


    @Data
    public class UserVo{
        private Long id;
        private String loginName;
        private String nickName;
        private String avatar;
        private String tel;
        private String email;
        private String remarks;
    }


    public UserVo transform(SysUserModel model ){
        return CopyUtils.copies(model,new UserVo());
    }

}
